package com.gofull.gateway.wechat.services;

import java.util.HashMap;
import java.util.Map;

import com.gofull.gateway.wechat.vo.WechatTemplate;
import com.gofull.gateway.wechat.vo.WechatTemplateData;
import com.shove.util.UtilDate;

public class WechatTemplateService {
	/**
	 * 账户开通提醒
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate accountOpeningRemind(String openid,
			String username, String pwd) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("iREwqNYW3UgdlRYnAK7WsMTT5XbDO4-WsoaC8FZY6cQ");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("您好，恭喜您的共富网账户已成功开通！");
		m.put("first", first);
		WechatTemplateData name = new WechatTemplateData();
		name.setColor("#173177");
		name.setValue(username);
		m.put("name", name);
		WechatTemplateData time = new WechatTemplateData();
		time.setColor("#000000");
		time.setValue(UtilDate.getDateFormatter());
		m.put("time", time);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#173177");
		remark.setValue("您的初始登录密码为：" + pwd + "。单击下方微信菜单“我要理财”，立即赢取收益吧。");
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 提现成功通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate withdrawSuccessNotice(String openid,
			String cardNo, String amount) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("1lJgCH_QilhWsS22g9xYEZfyxMoRmTuR-T8voynkxy8");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("您好，提现成功。");
		m.put("first", first);
		WechatTemplateData keyword1 = new WechatTemplateData();
		keyword1.setColor("#173177");
		keyword1.setValue("尾号" + cardNo);
		m.put("keyword1", keyword1);
		WechatTemplateData keyword2 = new WechatTemplateData();
		keyword2.setColor("#173177");
		keyword2.setValue(amount);
		m.put("keyword2", keyword2);
		WechatTemplateData keyword3 = new WechatTemplateData();
		keyword3.setColor("#000000");
		keyword3.setValue(UtilDate.getDateFormatter());
		m.put("keyword3", keyword3);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#173177");
		remark
				.setValue("24小时内到账，请注意查收，个别银行到账时间会晚1~2天。 如有疑问，请拨打咨询热线4008-893-983");
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 账户绑定通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate wechatBindNotice(String openid, String username) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("2I5TqsDuHDyH6UMRvgDxCa1s8xVYtXVsPVOQxsstRMU");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("您好，恭喜您账户绑定成功！");
		m.put("first", first);
		WechatTemplateData name1 = new WechatTemplateData();
		name1.setColor("#000000");
		name1.setValue("共富网账号:" + username);
		m.put("name1", name1);
		WechatTemplateData name2 = new WechatTemplateData();
		name2.setColor("#000000");
		name2.setValue("微信账户");
		m.put("name2", name2);
		WechatTemplateData time = new WechatTemplateData();
		time.setColor("#000000");
		time.setValue(UtilDate.getDateFormatter());
		m.put("time", time);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#000000");
		remark.setValue("您可以使用下方微信菜单进行更多体验。");
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 充值结果通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate rechargeResultNotice(String openid,
			String username, String amount, String channel, String bankname,
			String rechargeStatus) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("3DR7A_Rj6umfJTHSDVCxBh0Djx8XvUrPN8XQFS1WYTs");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("亲爱的" + username + "，您已于" + UtilDate.getDateFormatter()
				+ "成功充值。");
		m.put("first", first);
		WechatTemplateData keyword1 = new WechatTemplateData();
		keyword1.setColor("#000000");
		keyword1.setValue(username);
		m.put("keyword1", keyword1);
		WechatTemplateData keyword2 = new WechatTemplateData();
		keyword2.setColor("#000000");
		keyword2.setValue(amount);
		m.put("keyword2", keyword2);
		WechatTemplateData keyword3 = new WechatTemplateData();
		keyword3.setColor("#000000");
		keyword3.setValue(channel);
		m.put("keyword3", keyword3);
		WechatTemplateData keyword4 = new WechatTemplateData();
		keyword4.setColor("#000000");
		keyword4.setValue(bankname);
		m.put("keyword4", keyword4);
		WechatTemplateData keyword5 = new WechatTemplateData();
		keyword5.setColor("#000000");
		keyword5.setValue(rechargeStatus);
		m.put("keyword5", keyword5);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#000000");
		remark.setValue("备注：如有疑问,请致电4008-893-983联系我们");
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 获得共富券通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate awardGofullVoucherNotice(String openid,
			String amount, String remarkValue) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("53JoPBKNhaxAeF0zV8cvmqXY2--Ndnkv0xI4Fz1pXiI");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("你获赠了共富网理财共富券。");
		m.put("first", first);
		WechatTemplateData present_income = new WechatTemplateData();
		present_income.setColor("#000000");
		present_income.setValue(amount);
		m.put("present_income", present_income);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#000000");
		remark.setValue(remarkValue);
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 自动投资功能开通通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate openAutoBidNotice(String openid) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("Mk0RSvdXY0JwQziUF63ttX-7MCAVwSfX8uFSbyFFmVA");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("您好，恭喜您已成功开通自动投资功能！");
		m.put("first", first);
		WechatTemplateData name = new WechatTemplateData();
		name.setColor("#000000");
		name.setValue("自动投资");
		m.put("name", name);
		WechatTemplateData time = new WechatTemplateData();
		time.setColor("#000000");
		time.setValue(UtilDate.getDateFormatter());
		m.put("time", time);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#000000");
		remark.setValue("您可以使用下方微信菜单进行更多体验。");
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 自动投资功能关闭通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate closeAutoBidNotice(String openid) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("Mk0RSvdXY0JwQziUF63ttX-7MCAVwSfX8uFSbyFFmVA");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("您好，您已成功关闭自动投资功能！");
		m.put("first", first);
		WechatTemplateData name = new WechatTemplateData();
		name.setColor("#000000");
		name.setValue("自动投资");
		m.put("name", name);
		WechatTemplateData time = new WechatTemplateData();
		time.setColor("#000000");
		time.setValue(UtilDate.getDateFormatter());
		m.put("time", time);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#000000");
		remark.setValue("您可以使用下方微信菜单进行更多体验。");
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 收益到账通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate profitArrivalNotice(String openid,
			String content, String amount, String remarkValue) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("JafEGDeXCMwH_BmX_pehBRi7qki8D1T9OoCVoLmVoGQ");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue(content);
		m.put("first", first);
		WechatTemplateData income_amount = new WechatTemplateData();
		income_amount.setColor("#000000");
		income_amount.setValue(amount);
		m.put("income_amount", income_amount);
		WechatTemplateData income_time = new WechatTemplateData();
		income_time.setColor("#000000");
		income_time.setValue(UtilDate.getDateFormatter());
		m.put("income_time", income_time);
		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#000000");
		remark.setValue(remarkValue);
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

	/**
	 * 投资成功通知
	 * 
	 * @param
	 * @return WechatTemplate 模板消息
	 */
	public static WechatTemplate investSuccessNotice(String openid,
			String productName, String annualRate, String deadline,
			String investAmount, String recievedInterest) {
		WechatTemplate t = new WechatTemplate();
		t.setUrl("");
		t.setTouser(openid);
		t.setTopcolor("#000000");
		t.setTemplate_id("QxJjcotnzOr-vpW_cObOaOizQkyDdPesgd1IJPzori0");
		Map<String, WechatTemplateData> m = new HashMap<String, WechatTemplateData>();
		WechatTemplateData first = new WechatTemplateData();
		first.setColor("#000000");
		first.setValue("您已成功投资，明日开始计息。");
		m.put("first", first);

		WechatTemplateData keyword1 = new WechatTemplateData();
		keyword1.setColor("#000000");
		keyword1.setValue(productName);
		m.put("keyword1", keyword1);

		WechatTemplateData keyword2 = new WechatTemplateData();
		keyword2.setColor("#000000");
		keyword2.setValue(annualRate);
		m.put("keyword2", keyword2);

		WechatTemplateData keyword3 = new WechatTemplateData();
		keyword3.setColor("#000000");
		keyword3.setValue(deadline);
		m.put("keyword3", keyword3);

		WechatTemplateData keyword4 = new WechatTemplateData();
		keyword4.setColor("#000000");
		keyword4.setValue(investAmount);
		m.put("keyword4", keyword4);

		WechatTemplateData keyword5 = new WechatTemplateData();
		keyword5.setColor("#000000");
		keyword5.setValue(recievedInterest);
		m.put("keyword5", keyword5);

		WechatTemplateData remark = new WechatTemplateData();
		remark.setColor("#000000");
		remark.setValue("备注：如有疑问,请致电4008-893-983联系我们");
		m.put("remark", remark);
		t.setData(m);
		return t;
	}

}
